﻿@model IEnumerable<CarSales.Models.Owner>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.OwnName)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.OwnAddress1)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.OwnAddress2)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.OwnSuburb)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.OwnState)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.OwnContactPhone)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.OwnContactEmail)
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.OwnName)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.OwnAddress1)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.OwnAddress2)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.OwnSuburb)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.OwnState)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.OwnContactPhone)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.OwnContactEmail)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.OwnId }) |
            @Html.ActionLink("Details", "Details", new { id=item.OwnId }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.OwnId })
        </td>
    </tr>
}

</table>
